<HTML>
<HEAD>
<TITLE>[Chapter 1] 1.5 And the Rest</TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 14:21:40 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch01_04.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 1<br>Abstract Window Toolkit Overview</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch01_06.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=sect1>
<h2 CLASS=sect1><A CLASS="TITLE" NAME="JAWT-CH-1-SECT-5">1.5 And the Rest</A></h2>

<P CLASS=para>
Several of the remaining classes within <tt CLASS=literal>java.awt</tt> 
are important to mention here but did not fit well into a general category. 
The following sections are a grab bag that summarize the remaining classes. 

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JAWT-CH-1-SECT-5.1">Drawing and Graphics</A></h3>

<P CLASS=para>
Java provides numerous primitives for drawing lines, squares, circles, 
polygons, and images. <A HREF="ch01_05.htm#JAWT-CH-1-FIG-22">Figure 1.21</A> shows a simple drawing. 
The drawing components of AWT are discussed in 
<A HREF="ch02_01.htm">Chapter 2, <i>Simple Graphics</i></A>. 

<P CLASS=para>
The <tt CLASS=literal>Font</tt>, <tt CLASS=literal>FontMetrics</tt>, 
<tt CLASS=literal>Color</tt>, and <tt CLASS=literal>SystemColor</tt> 
classes provide the ability to alter the displayed output. With the <tt CLASS=literal>Font</tt> 
class, you adjust how displayed text will appear. With <tt CLASS=literal>FontMetrics</tt>, 
you can find out how large the output will be, for the specific system 
the user is using. You can use the <tt CLASS=literal>Color</tt> 
class to set the color of text and graphics. <tt CLASS=literal>SystemColor</tt> 
is new to Java 1.1; it lets you take advantage of desktop color schemes. 
These classes are discussed in <A HREF="ch03_01.htm">Chapter 3, <i>Fonts and Colors</i></A>. 

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JAWT-CH-1-FIG-22">Figure 1.21: A simple drawing</A></h4>


<p>
<img align=middle src="./figs/jawt0122.gif" alt="[Graphic: Figure 1-21]" width=188 height=236 border=0>

</DIV>

<P CLASS=para>
AWT also includes a number of classes that support more complex graphics 
manipulations: displaying images, generating images in memory, and transforming 
images. These classes make up the package <tt CLASS=literal>java.awt.image</tt>, 
which is covered in <A HREF="ch12_01.htm">Chapter 12, <i>Image Processing</i></A>. 

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JAWT-CH-1-SECT-5.2">Events</A></h3>

<P CLASS=para>
Like most windows programming environments, AWT is event driven. When an 
event occurs (for example, the user presses a key or moves the mouse), 
the environment generates an event and passes it along to a handler to 
process the event. If nobody wants to handle the event, the system ignores 
it. Unlike some windowing environments, you do not have to provide a main 
loop to catch and process all the events, or an infinite busy-wait loop. 
AWT does all the event management and passing for you. 

<P CLASS=para>
Probably the most significant difference between versions 1.0.2 and 1.1 
of AWT is the way events work. In older versions of Java, an event is distributed 
to every component that might conceivably be interested in it, until some 
component declares that it has handled the event. This event model can 
still be used in 1.1, but there is also a new event model in which objects 
listen for particular events. This new model is arguably a little more 
work for the programmer but promises to be much more efficient, because events 
are distributed only to objects that want to hear about them. It is also 
how JavaBeans works. 

<P CLASS=para>
In this book, examples that are using the older (1.0.2) components use 
the old event model, unless otherwise indicated. Examples using new components 
use the new event model. Don't let this mislead you; all components 
in Java 1.1 support the new event model. The details of <tt CLASS=literal>Event</tt> 
for both version 1.0.2 and 1.1 can be found in <A HREF="ch04_01.htm">Chapter 4, <i>Events</i></A>. 

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JAWT-CH-1-SECT-5.3">Applets</A></h3>

<P CLASS=para>
Although it is not a part of the <tt CLASS=literal>java.awt</tt> 
package, the Core Java API provides a framework for applet development. 
This includes support for getting parameters from HTML files, changing 
the web page a browser is displaying, and playing audio files. <A HREF="ch14_01.htm">Chapter 14, <i>And Then There Were Applets</i></A>, describes all the details of the <tt CLASS=literal>java.applet</tt> 
package. Because audio support is part of <tt CLASS=literal>java.applet</tt>, 
portable audio playing is limited to applets. <A HREF="ch14_01.htm">Chapter 14, <i>And Then There Were Applets</i></A> 
also shows a nonportable way to play audio in applications. Additional 
audio capabilities are coming to the Java Core API in the announced extensions. 

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JAWT-CH-1-SECT-5.4">Clipboards</A></h3>

<P CLASS=para>
In Java 1.1, programs can access the system clipboard. This process makes 
it easier to transfer (cut, copy, and paste) data between various other 
sources and your Java programs and introduces developers to the concepts 
involved with JavaBeans. <A HREF="ch16_01.htm">Chapter 16, <i>Data Transfer</i></A>, describes the <tt CLASS=literal>java.awt.datatransfer </tt>package. 

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JAWT-CH-1-SECT-5.5">Printing</A></h3>

<P CLASS=para>
Java 1.1 adds the ability to print. Adding printing to an 
existing program is fairly simple: you don't have to do much beside adding 
a Print menu button. <A HREF="ch17_01.htm">Chapter 17, <i>Printing</i></A>, describes these capabilities. 

</DIV>

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch01_04.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch01_06.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Containers</td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>Summary</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
